import {http} from '../http';

// 实例化类
const _HTTP = new http();

/**
 * 获取我发布的任务
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const publistTask =function (data, header) {
    return _HTTP.request({
        method:'GET',
        url: '/member/getmyservice',
        data,
        header
    })
}


/**
 * 删除我发布的任务
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const deleteTask = function (data, header) {
    return _HTTP.request({
        method: 'POST',
        url: '/member/delmyservice',
        data:data,
        header
    })
}
/**
 * 获取我预约的创业服务列表接口
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const reserveList = function (data,header) {
    return _HTTP.request({
        method: 'GET',
        url: '/member/getmyreserve',
        data,
        header
    })
}

//认证中心API

/**
 * 提交认证资料，修改资料接口
 * @param data
 * @param header
 * @returns {Promise<unknown>}
 */
export const postCert = function (data,header) {
    return _HTTP.request({
        method: 'POST',
        url: '/member/postcert',
        data,
        header
    })
}


/**
 * 发布服务，修改服务接口
 * @param data
 * @param header
 * @returns {Promise<unknown>}
 */
export const postservice = function (data,header) {
    return _HTTP.request({
        method: 'POST',
        url: '/member/postservice',
        data,
        header
    })
}

/**
 * 获取服务类型列表
 * @param data
 * @param header
 * @returns {Promise | Promise<unknown>}
 */
export const serviceList = function (data,header) {
    return _HTTP.request({
        method: 'GET',
        url: '/service/getServiceType',
        data,
        header
    })
}



export const postrent = function (data, header) {
    return _HTTP.request({
        method: "POST",
        url:"/member/postrent",
        data,
        header,
    })
}



export const getmy = function (data, header) {
    return _HTTP.request({
        method: "GET",
        url:"/member/getmy",
        data,
        header,
    })
}
// 获取所有区域接口
export const getAllArea = function (r) {
    return _HTTP.request({
        method: "GET",
        url:"/member/getAllArea",
    })
}

// 获取所有地铁线路接口
export const getAllsubway = function (r) {
    return _HTTP.request({
        method: "GET",
        url:"/member/getAllsubway",
    })
}

// 获取基础服务
export const getAllBasicService = function (r) {
    return _HTTP.request({
        method: "GET",
        url:"/member/getAllBasicService",
    })
}

/**
 * 获取我发布的招租信息列表接口
 * @return {[type]} [description]
 */
export const getmyrent=function(data, header){
    return _HTTP.request({
        method: "GET",
        url: "/member/getmyrent",
        data,
        header
    })
}
/**
 * 获取招租信息所有类别
 * @param  {[type]} data   [description]
 * @param  {[type]} header [description]
 * @return {[type]}        [description]
 */
export const getJPlist=function(){
    return _HTTP.request({
        method: "GET",
        url: "/rent/getRentAllType",
    })
}



/**
 * 获取招租信息列表接口-有分页
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export const getZzLists = function(data){
    return _HTTP.request({
        method: "GET",
        url: "/rent/listpage",
        data,
    })
}

/**
 * 获取单个招租信息接口
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export const getZzDetail =function(data){
    return _HTTP.request({
        method: 'GET',
        url: "/rent/get",
        data: data,
    })
}



/**
 * 获取招租信息列表接口-无分页
 * @param  {[type]} data [description]
 * @return {[type]}      [description]
 */
export const getZzList = function (data) {
     return _HTTP.request({
        method: 'GET',
        url: "/rent/List",
        data: data,
    })
}


//刪除我發佈的招租信息
export const delMyPublishZhaozu = function (data,header) {
    return _HTTP.request({
        method: 'GET',
        url: "/member/delmyrent",
        data: data,
        header,
    })
}
// 删除发不的
// 
export const deldelmyservice = function (data,header) {
    return _HTTP.request({
        method: 'GET',
        url: "/member/delmyservice",
        data: data,
        header,
    })
}